package com.cskaoyan.javase.method.exercise4;

/**
 * @description: 练习2
 * @author: wuguidong@cskaoyan.onaliyun.com
 **/

/**
 * 定义一个方法，求圆的面积
 *
 * - 方法参数:半径 (radius)
 * - 圆周率:3.14
 *
 *
 */
public class Demo2 {
    public static void main(String[] args) {
        //调用
        int a  = 2;
        System.out.println("半径为" + a + "的圆，面积为:" + getArea(a));
    }

    public static double getArea(double radius) {
        return 3.14 * radius * radius;
    }
}
